package hn.cch.controller;


import hn.cch.entity.Product;
import hn.cch.entity.User;
import hn.cch.service.UserService;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;


@RequestMapping(value = "user")
@RestController
public class UserController {

    public static Logger logger = LoggerFactory.getLogger(UserController.class);


    @Autowired
    private UserService userService;


    @GetMapping(value = "getOne/{id}")
    public User getOne(@PathVariable Integer id){
        logger.info("getOne");
        return userService.findById(id);
    }


}
